package com.itheima.service.impl;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TripServiceImpl implements TripService {
    //自动装配
    @Autowired
    private TripMapper tripMapper;

    public List<Trip> queryAll() {
        List<Trip> list = tripMapper.queryAll();
        return list;
    }

    public void insert(Trip trip) {
        tripMapper.insert(trip);
    }

    public Trip queryById(Integer id) {
        Trip trip = tripMapper.queryById(id);
        return trip;
    }

    public void updateById(Trip trip) {
        tripMapper.updateById(trip);
    }

    public void deleteById(Integer id) {
        tripMapper.deleteById(id);
    }
}
